package com.fanqwz.hexieshe.domain.usercase;

import com.fanqwz.hexieshe.domain.Category;
import com.fanqwz.hexieshe.domain.executor.PostExecutionThread;
import com.fanqwz.hexieshe.domain.repository.Repository;

import java.util.List;
import java.util.concurrent.Executor;

import javax.inject.Inject;

import io.reactivex.Observable;

/**
 * Created by fanqw on 2017/7/2.
 */

public class GetCategoryUseCase extends UseCase<List<Category>, GetCategoryUseCase.Params> {
    private final Repository repository;

    @Inject
    GetCategoryUseCase(Repository repository, Executor threadExecutor, PostExecutionThread postExecutionThread) {
        super(threadExecutor, postExecutionThread);
        this.repository = repository;
    }

    @Override
    Observable<List<Category>> buildUseCaseObservable(Params params) {
        return repository.categories();
    }

    public static class Params {
    }
}
